package com.base.cn.platform.os.service.manage.user.integral;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@FeignClient(value = BaseService.appName,configuration = FeignAuthConfig.class)
public interface CusUserIntegralService extends BaseService {
    /**
     * 用户ID搜索积分
     * @param userId
     * @return
     */
    @RequestMapping(contextPath + "/user/queryUserIntegralByUserId")
    Map<String,Object> queryUserIntegralByUserId(@RequestParam("userId") BigDecimal userId);

    /**
     * 添加用户积分
     * @param actionKey 动作KEY
     * @param userId 用户ID
     * @param recordType 记录类型，1消耗积分，2 获取积分
     * @param score 赠送积分必填
     * @param otherId 其他id
     * @return Map<String,Object>
     */
    @RequestMapping(contextPath + "/user/addUserIntegral")
    Map<String,Object> addUserIntegral(@RequestParam(value = "actionKey", required = false) String actionKey,
                                       @RequestParam("userId") BigDecimal userId,
                                       @RequestParam(value = "otherId", required = false, defaultValue = "0") BigDecimal otherId,
                                       @RequestParam(value = "score", required = false, defaultValue = "0") int score,
                                       @RequestParam("recordType") int recordType);

    /**
     * 批量添加用户积分
     * @param userIdList 用户id集合
     * @param actionKey 规则key
     */
    @RequestMapping(contextPath+"/user/batchAddUserIntegral")
    void  batchAddUserIntegral(@RequestParam("userIdList") List<BigDecimal> userIdList, @RequestParam("actionKey") String actionKey);
}
